package com.cainaer.orders.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cainaer.orders.domain.OrderSetting;
import com.cainaer.orders.mapper.OrderSettingMapper;
import com.cainaer.orders.service.IOrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单设置表 服务实现类
 * </p>
 *
 * @author Tina
 * @since 2020-09-11
 */
@Service
public class OrderSettingServiceImpl extends ServiceImpl<OrderSettingMapper, OrderSetting> implements IOrderSettingService {

    @Autowired
    private OrderSettingMapper orderSettingMapper;

    /**
     * 新增 订单设置
     *
     * @param orderSetting
     * @return
     */
    @Override
    public Integer insertOrderSetting(OrderSetting orderSetting) {
        return orderSettingMapper.insert(orderSetting);
    }

    /**
     * 编辑 订单设置
     *
     * @param orderSetting
     * @return
     */
    @Override
    public Integer editOrderSetting(OrderSetting orderSetting) {
        return orderSettingMapper.updateById(orderSetting);
    }

    /**
     * 查询 订单设置
     *
     * @param orderSetting
     * @return
     */
    @Override
    public List<OrderSetting> selectOrderSetting(OrderSetting orderSetting) {
        QueryWrapper queryWrapper = new QueryWrapper();
        return orderSettingMapper.selectList(queryWrapper);
    }
}
